﻿using Sys.Core.Models.Dto;
using Sys.Core.Models.Queries;
using Sys.Core.Models.VO;
using Sys.Core.Services;
using MiniFox.Components;
using MiniFox.Infrastructure;

namespace Sys.Core
{
    /// <summary>
    /// 角色及权限设定
    /// </summary>
    [AutoRegister, SpareComponent(typeof(RoleService))]
    public interface IRoleService
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        ResultObject<IEnumerable<RoleVo>> Query(PagedQueryObject<RoleQuery> request);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="roleId"></param>
        /// <returns></returns>
        RoleVo Item(string roleId);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="role"></param>
        /// <returns></returns>
        RoleVo Create(RoleDto role);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="role"></param>
        /// <returns></returns>
        RoleVo Update(RoleDto role);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="roles"></param>
        string Delete(string roleId);


        #region Modules

        /// <summary>
        /// 
        /// </summary>
        /// <param name="roleModuleSet"></param>
        /// <returns></returns>
        bool AddRoleModules(RoleModuleSet roleModuleSet);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="roleModuleSet"></param>
        /// <returns></returns>
        bool RemoveRoleModules(RoleModuleSet roleModuleSet);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="roleId"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        ResultObject<IEnumerable<ModuleVo>> InclusionModules(string roleId, PagedQueryObject<ModuleQuery> request);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="roleId"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        ResultObject<IEnumerable<ModuleVo>> ExclusionModules(string roleId, PagedQueryObject<ModuleQuery> request);
        #endregion

        #region Users
        /// <summary>
        /// 
        /// </summary>
        /// <param name="roleUserSet"></param>
        /// <returns></returns>
        bool AddRoleUsers(RoleUserSet roleUserSet);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="roleUserSet"></param>
        /// <returns></returns>
        bool RemoveRoleUsers(RoleUserSet roleUserSet);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="roleId"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        ResultObject<IEnumerable<UserVo>> InclusionUsers(string roleId, PagedQueryObject<UserQuery> request);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="roleId"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        ResultObject<IEnumerable<UserVo>> ExclusionUsers(string roleId, PagedQueryObject<UserQuery> request);
        #endregion
    }
}
